package com.mida.dms.knw.mapper;

import com.mida.dms.knw.entity.KnwCommonWordsTree;
import com.mida.dms.knw.vo.CommonWordsTreeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface KnwCommonWordsTreeMapper {
    int deleteByPrimaryKey(Long commonWordsTreeSoid);

    int insert(KnwCommonWordsTree record);

    int insertSelective(KnwCommonWordsTree record);

    KnwCommonWordsTree selectByPrimaryKey(Long commonWordsTreeSoid);

    int updateByPrimaryKeySelective(KnwCommonWordsTree record);

    int updateByPrimaryKey(KnwCommonWordsTree record);

    Integer count(@Param("surperCommonWordsTreeSoid") Long surperCommonWordsTreeSoid);

    void deleteBySurperTreeSoid(@Param("surperCommonWordsTreeSoid") Long surperCommonWordsTreeSoid);

    Integer selectMax(@Param("surperCommonWordsTreeSoid") Long surperCommonWordsTreeSoid,@Param("businessUnitSoid") Long businessUnitSoid);

    List<KnwCommonWordsTree> selectSuperTree();

    void updateSeriaNoForList(@Param("knwCommonWordsTrees") List<KnwCommonWordsTree> knwCommonWordsTrees);

    List<KnwCommonWordsTree> selectBySuperTreeSoid(@Param("surperCommonWordsTreeSoid") Long surperCommonWordsTreeSoid);

    List<CommonWordsTreeVo> getKnwCommonWordsTree(Map<String, Object> map);

    List<KnwCommonWordsTree> selectAll(Map<String, Object> stringLongHashMap);

    List<KnwCommonWordsTree> selectChildTreeSoid(@Param("commonWordsTreeSoid") Long commonWordsTreeSoid);

    void updateChildTreeSoid(@Param("commonWordsTreeSoids") List<Long> commonWordsTreeSoids,@Param("isShare") Short isShare);

    void updateSuperAndChildSoid(@Param("commonWordsTreeSoid") Long commonWordsTreeSoid,@Param("surperCommonWordsTreeSoid") Long surperCommonWordsTreeSoid,@Param("isShare")Short isShare);

    List<CommonWordsTreeVo> selectTreeList(Map<String, Object> stringLongHashMap);

    Integer countIsShare(Long surperCommonWordsTreeSoid);

    List<CommonWordsTreeVo> selectAllTree();


    void deleteCommonWordsTree(@Param("knwCommonWordsTrees")List<KnwCommonWordsTree> knwCommonWordsTrees);

    List<CommonWordsTreeVo> selectPersonalTreeList(Map<String, Object> stringLongHashMap);

    Integer queryInstance(@Param("allChreidSoids")List<Long> allChreidSoids);

    List<CommonWordsTreeVo> search(@Param("queryName") String queryName,@Param("creator") Long creator);

    List<KnwCommonWordsTree> selectBySuperTreeSoids(@Param("surperCommonWordsTreeSoid") Long surperCommonWordsTreeSoid, @Param("creator") Long creator,@Param("businessUnitSoid") Long businessUnitSoid);
}